var AV = require('leanengine');
var async = require('async');
//获取当前的版本信息
exports.initialize = function (req,res,next) {
    //TODO:获取app当前的版本号
    //数据初始化
    //console.log(global.initData.level);
    async.auto({
        level:function(callback){
            require('../initialize.js').init().then(function(mmm){
                callback(null, {code:1});
            });
        },
        activity:function(callback){
            require('../initialize.js').activity().then(function(mmm){
                callback(null, {code:1});
            });
        },
        limitClassify:function(){
            require('../initialize.js').limitClassify().then(function(mmm){
                callback(null, {code:1});
            });
        }
    },function(err,result){
        if(err){
            res.json({info:"活动更新失败",status:0,url:"GROperate/index.php?s=/Admin/Activity/index.html"});
        }else{
            res.json({info:"活动更新成功",status:1,url:"/GROperate/index.php?s=/Admin/Activity/index.html"});
        }
    });
}